package main.java.service;

import main.java.thrift.generated.DataException;
import main.java.thrift.generated.Person;
import main.java.thrift.generated.PersonService;
import org.apache.thrift.TException;

/**
 * ${DESCRIPTION}
 *
 * @author cx
 * @create 2018-03-22 14:31
 **/
public class PersonServiceImpl implements PersonService.Iface {
    @Override
    public Person getPersonByUsername(String username) throws DataException, TException {
        System.out.println("Got client Param:" + username);

        Person person = new Person();
        person.setUsername(username);
        person.setAge(13);
        person.setMarried(false);

        return person;
    }

    @Override
    public void savePerson(Person person) throws DataException, TException {
        System.out.println("Got Client Param: ");

        System.out.println(person.getUsername());
        System.out.println(person.getAge());
        System.out.println(person.isMarried());
    }
}
